load("@npm//@bazel/esbuild:index.bzl", "esbuild_config")
load("//tools:defaults.bzl", "ts_library")

package(default_visibility = ["//visibility:public"])

exports_files([
    "rollup.config.js",
    "terser-config.json",
    "index-tmpl.ts",
])

esbuild_config(
    name = "esbuild_config",
    config_file = "esbuild.config.mjs",
    deps = [
        "@npm//@angular/build",
        "@npm//@angular/compiler-cli",
        "@npm//@babel/core",
    ],
)

ts_library(
    name = "check-size",
    srcs = ["check-size.ts"],
    # TODO(ESM): remove this once the Bazel NodeJS rules can handle ESM with `nodejs_binary`.
    devmode_module = "commonjs",
    deps = [
        "@npm//@bazel/runfiles",
        "@npm//@types/node",
        "@npm//@types/yaml",
        "@npm//chalk",
        "@npm//yaml",
    ],
)
